package com.itqf.factorybean;

import org.quartz.JobBuilder;
import org.quartz.JobDetail;
import org.springframework.beans.factory.FactoryBean;

/**
 * projectName: logandquratz2103
 *
 * @author: 赵伟风
 * time: 2021/7/6 17:13
 * description: 专门造jobDetail
 */
public class JobDetailFactoryBean  implements FactoryBean<JobDetail> {

    private Class jobClass;

    public Class getJobClass() {
        return jobClass;
    }

    public void setJobClass(Class jobClass) {
        this.jobClass = jobClass;
    }

    @Override
    public JobDetail getObject() throws Exception {

        JobDetail jobDetail = JobBuilder.newJob(jobClass).build();

        return jobDetail;
    }

    @Override
    public Class<?> getObjectType() {
        return JobDetail.class;
    }
}
